import java.io.*;

public class Demo856 {
    public static void main(String[] args) throws FileNotFoundException {
        try(OutputStream outputStream = new FileOutputStream("./text.txt")){
            PrintStream printStream = new PrintStream(outputStream);
            printStream.printf("我是第一行");
            printStream.println("我是第二行");
            printStream.println("我是第三行");
            outputStream.flush();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
